/*
 * @Description: 数据转换
 * @Date: 2024-02-19 10:07:10
 * @FilePath: \demod:\12electron\electron-demo\src\renderer\src\utils\transData.ts
 */

// 将获取的串口Uint8Array数据转换成字符串
export const transUint8ArrayToString = (data: Uint8Array) => {
  let str = ''
  for (let i = 0; i < data.length; i++) {
    console.log(data[i])
    str += String.fromCharCode(data[i])
  }
  return str
}
